package org.fujay.langchain4jserver.domain.model.event;

import lombok.Getter;
import org.fujay.langchain4jserver.domain.model.vo.ModelConfig;
import org.fujay.langchain4jserver.domain.model.vo.ModelId;
import org.springframework.context.ApplicationEvent;

/**
 * 模型配置变更事件
 */
@Getter
public class ModelConfigUpdatedEvent extends ApplicationEvent {

    private final ModelId modelId;
    private final ModelConfig newConfig;

    // Add old config if listeners need it for comparison

    /**
     * Create a new ModelConfigUpdatedEvent.
     *
     * @param source    the component that published the event
     * @param modelId   the ID of the updated model
     * @param newConfig the new configuration
     */
    public ModelConfigUpdatedEvent(Object source, ModelId modelId, ModelConfig newConfig) {
        super(source);
        this.modelId = modelId;
        this.newConfig = newConfig;
    }
}
